package heap;

import java.util.*; 


public class ResultRow {
	ArrayList < String > list = new ArrayList < String > () ;
	
//	public ResultRow() {
//		
//	}
	
	public void set (int index, String value) {
		list.set(index, value);
	}
	
	public void add ( String f )  {
		list.add( f ) ; 
	}
	
	public int getInt ( String name, ResultSchema sch ) throws Exception {
		int index = sch.getNameIndex( name ) ;
		return Integer.valueOf( list.get( index ) ) ; 
	}
	
	public String getString ( String name, ResultSchema sch ) throws Exception {
		int index = sch.getNameIndex( name ) ;
		return list.get( index )  ;
	}
	
	public String get ( int index ) { 
		return list.get( index ) ;
	}
	
	public int size () {
		return list.size() ; 
	}
	
	public int compareTo() {
		return 0;
	}
	
	public String toString(){
		String tmp="";
		for(String s:list)
			tmp += s+" ";
		return tmp;
	}
}
